import Vue from 'vue'
import VueRouter from 'vue-router'
import Music from '../views/Music/Music.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/music',
    name: 'Music',
    component: Music
  },
  {
    path: '/top250',
    name: 'Top250',
    component: () => import('../views/Top250/Top250.vue')
  },
  {
    path: '/musicDetail/:id',
    name: 'MusicDetail',
    component: () => import('../views/Music/MusicDetail.vue')
  },
  {
    path: '/top250Detail/:id',
    name: 'Top250Detail',
    component: () => import('../views/Top250/Top250Detail.vue')
  },
  {
    path: '/moreMusic',
    name: 'moreMusic',
    component: () => import('../views/More/MoreMusic.vue')
  },
  {
    path: '/moreMusicDetail',
    name: 'moreMusicDetail',
    component: () => import('../views/More/MoreMusicDetail.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
